<script setup lang="ts">
import { ref, onBeforeMount } from 'vue'
import { UserLayout } from '@/layouts'
import accountForm from './account.vue'
import phoneForm from './phone.vue'
import { user as useUser } from '@/store'

const activeName = ref<'account' | 'phone'>('account')
const user = useUser()
if (user.loginInfo.activeTab) activeName.value = user.loginInfo.activeTab

const handleToggleLoginWay = (key: any) => {
	// console.log(key)
}
</script>

<template>
	<UserLayout>
		<div class="login">
			<a-tabs v-model:activeKey="activeName" class="login-tabs" @tab-click="handleToggleLoginWay">
				<a-tab-pane tab="账号登录" key="account">
					<account-form />
				</a-tab-pane>
				<a-tab-pane tab="手机号登录" key="phone">
					<phone-form />
				</a-tab-pane>
			</a-tabs>
		</div>
	</UserLayout>
</template>

<style scoped lang="less"></style>
